package com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy;

import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.code.CodeDefineVarNodeStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.code.CodeJsCodeNodeStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.code.CodeSqlCodeNodeStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.controller.*;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.in.InHttpStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.in.InJdbcPageStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.in.InJdbcStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.in.InValidateStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.nosql.NosqlPageStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.nosql.NosqlSaveStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.out.OutEmailStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.out.OutExcelStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.out.OutLogStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.out.OutNotifyInfoStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.ui.UIOutDataNodeStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.ui.UITokenNodeStrategy;
import com.wxy.ej.flow.modules.taskflow.service.nodeExecuteStrategy.strategy.ui.UiInParamNodeStrategy;

public class NodeStrategyFactory {

    public static NodeStrategy getStrategy(String type) {
        switch (type) {
            case "link": {
                return new LinkStrategy();
            }
            case "controller-start-node": {
                return new ControllerStartNodeStrategy();
            }
            case "controller-end-node": {
                return new ControllerEndNodeStrategy();
            }
            case "controller-circle-start-node": {
                return new ControllerCircleStartNodeStrategy();
            }
            case "controller-break-node": {
                return new ControllerBreakNodeStrategy();
            }
            case "controller-continue-node": {
                return new ControllerContinueNodeStrategy();
            }
            case "controller-return-node": {
                return new ControllerReturnNodeStrategy();
            }
            case "controller-combine-node": {
                return new ControllerCombineNodeStrategy();
            }
            case "controller-if-start-node": {
                return new ControllerIfStartNodeStrategy();
            }
            case "controller-route-node": {
                return new ControllerRouteNodeStrategy();
            }
            case "code-define-var-node": {
                return new CodeDefineVarNodeStrategy();
            }
            case "code-js-code-node": {
                return new CodeJsCodeNodeStrategy();
            }
            case "code-sql-code-node": {
                return new CodeSqlCodeNodeStrategy();
            }

            case "ui-in-param-node": {
                return new UiInParamNodeStrategy();
            }
            case "ui-out-data-node": {
                return new UIOutDataNodeStrategy();
            }
            case "ui-token-node": {
                return new UITokenNodeStrategy();
            }

            case "in-jdbc-node": {
                return new InJdbcStrategy();
            }
            case "in-jdbc-page-node": {
                return new InJdbcPageStrategy();
            }
            case "in-http-node": {
                return new InHttpStrategy();
            }
            case "in-validate-node": {
                return new InValidateStrategy();
            }
            case "out-log-node": {
                return new OutLogStrategy();
            }
            case "out-excel-node": {
                return new OutExcelStrategy();
            }
            case "out-email-node": {
                return new OutEmailStrategy();
            }
            case "out-notify-info-node": {
                return new OutNotifyInfoStrategy();
            }
            // mongodb
            case "nosql-save-node": {
                return new NosqlSaveStrategy();
            }
            case "nosql-page-node": {
                return new NosqlPageStrategy();
            }
        }
        return null;
    }
}
